import Vue from "vue";
import Vuex from "vuex";
import createPersistedState from "vuex-persistedstate";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    menuSelect: "",
  },
  mutations: {
    menuSelect(state, val) {
      state.menuSelect = val;
    },
  },
  actions: {},
  modules: {},
  plugins: [
    createPersistedState({
      storage: window.sessionStorage,
      reducer(val) {
        return {
          menuSelect: val.menuSelect,
        };
      },
    }),
  ],
});
